
//1. Can virtual member function be private?Yes!
//2. 
#include <iostream>
using namespace std;
class Base{
public:
  virtual void foo(){cout<<"Base::foo()"<<endl;}
};
class Derived:public Base{
  void foo(){ cout<<"Derived::foo()"<<endl; }
public:
  int i;
};
int main()
{
  Derived d;
  Base* ptr = &d;
  ptr->foo();
  Base b;
  b.foo();
  //d.foo(); but only works for polymorphic mechanics
}

//****************Answer 1*******************
//Amazing!!!
//the Base::foo() have to be public but the Derived can be private!!!

